//
// Created by v on 24-12-24.
//

#ifndef JKLIBS_CMAISERVICEINTERFACE_H
#define JKLIBS_CMAISERVICEINTERFACE_H

#include <vector>

#include "cm_service_base.h"

class CMAIRecogItem
{
  public:
    std::string name;
    float score;
};

class CMAIServiceInterface : public CMServiceBaseInterface
{
  public:
    CMAIServiceInterface();
    virtual ~CMAIServiceInterface();

    int init() override;
    int deinit() override;
    int ctl(int type, void *args) override;

    virtual int init_model(const char *model_path, char *label_file) = 0;
    virtual int deinit_model() = 0;

    virtual int recognize(const char *buf, size_t img_size, std::vector<CMAIRecogItem> &results) = 0;

  protected:
    int run() override;
};

#endif // JKLIBS_CMAISERVICEINTERFACE_H
